<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="language" content="en" />
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/yui/reset.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/tool/tool.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/tool/table1/style.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo $this->getTemplatePath('rc/style.css'); ?>" />
    <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/app/app.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js"></script>
    <title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>
<body>

<div id="wrap">
    
    <div id="header">
        <div id="logo"></div>
    </div>

    <div id="nav">
        <ul>
            <!--
            <li><a href="dashboard.html">網站摘要</a></li>
            <li><a href="content.html" class="current">內容管理</a></li>
            <li><a href="blog.html" >網址管理</a></li>
            -->
            <?php
                foreach( $this->menus->getMenusByMasterMenu() as $menu ) {
                    if($menu->isFocus()) {
                        $menuId = $menu->getId();
                        echo "<li><a href=\"{$menu->getUrl($this)}\" class=\"current\">{$menu->getMenu()}</a></li>";
                    }
                    else {
                        echo "<li><a href=\"{$menu->getUrl($this)}\">{$menu->getMenu()}</a></li>";
                    }
                }
            ?>
        </ul>
    </div>

    <div id="content">

        <div id="left_sidebar">
            <ul>
                <!--
                <li><a href="index.html" class="current" >Home</a></li>
                <li><a href="blog.html">Blog</a></li>
                <li><a href="About.html">About</a></li>
                -->
                <?php
                    if($menuId) {
                        foreach( $this->menus->getMenusByMasterMenuId($menuId) as $menu ) {
                            if($menu->isFocus()) {
                                echo "<li><a href=\"{$menu->getUrl($this)}\" class=\"current\">{$menu->getMenuItem()}</a></li>";
                            }
                            else {
                                echo "<li><a href=\"{$menu->getUrl($this)}\">{$menu->getMenuItem()}</a></li>";
                            }
                        }
                    }
                    else {
                        echo "<li><a href=\"#\">nothing</a></li>";
                    }
                ?>
            </ul>
        </div>

<!--
        <div id="breadcrumbs">
        </div>
        <br />
-->

        <div id="main">

            <div id="breadcrumbs">
                <?php
                    $focusMenu = $this->menus->getMenuByFocus();
                    echo "{$focusMenu->getMenu()} &raquo; {$focusMenu->getMenuItem()} ";
                ?>  
            </div>
            <div class="">
                <?php echo $content; ?>
            </div>
        </div>
        <br style="clear:both;" />

    </div>

</div>

<div id="footer">
    Copyright &copy; <?php echo date('Y'); ?> by My Gii.<br/>
    All Rights Reserved.
</div>


<script type="text/javascript">

    $(document).ready(function() {

        $('table:eq(0) tr:gt(0):odd  > th').addClass('th2');
        $('table:eq(0) tr:gt(0):even > th').addClass('th1');
        $('table:eq(0) tr:odd  > td').addClass('td1');
        $('table:eq(0) tr:even > td').addClass('td2');

        $('table:eq(1) tr:gt(0):odd  > th').addClass('th2');
        $('table:eq(1) tr:gt(0):even > th').addClass('th1');
        $('table:eq(1) tr:odd  > td').addClass('td1');
        $('table:eq(1) tr:even > td').addClass('td2');

        $("#chooseItemsAll").click(function() {
            var chooseItems = $("input[name='chooseItems\\[\\]']");
            if( $(this).attr('checked') ) {
                chooseItems.attr('checked','checked');            
            }
            else {
                chooseItems.attr('checked','');
            }
        });

   });

    $(document).ready(function() {
        $(".openWorkWin").click(app.openWorkWindow);
    });

</script>

</body>
</html>